package com.hackintosh.bus;

import java.util.HashSet;
import java.util.Set;

/**
 * @description：
 * @author：twislyn
 * @date：Created in 2021/06/06
 * @modified By：
 * @version: 1.0
 */
public class TerminalExpression implements Expression {
    private Set<String> set = new HashSet<>();

    public TerminalExpression(String[] data) {
        for (int i = 0,len=data.length; i < len; i++) {
            set.add(data[i]);
        }
    }

    @Override
    public boolean interpret(String info) {
        if(set.contains(info)){
            return true;
        }
        return false;
    }
}
